package com.malty.mall.domain.dto.req;

import com.malty.mall.domain.entity.ums.UmsRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author malty
 */
@Data
@ApiModel("角色参数")
@NoArgsConstructor
public class UmsRoleParam {
    private Integer id;
    @ApiModelProperty("角色名称")
    @NotEmpty(message = "角色名称必填")
    private String roleName;
    @ApiModelProperty("角色描述")
    @NotEmpty(message = "角色描述必填")
    private String description;
    @ApiModelProperty("角色状态")
    @NotNull(message = "角色状态必填")
    private Integer status;
    @ApiModelProperty("角色数量")
    private Integer count;

    public UmsRoleParam(UmsRole umsRole) {
        BeanUtils.copyProperties(umsRole, this);
    }
}
